<?php
/**
 * Created by PhpStorm.
 * User: 24369
 * Date: 2021/6/25
 * Time: 8:58
 */
namespace app\admin\model;

use think\Model;
use think\model\concern\SoftDelete;

class Category extends Model
{
    use SoftDelete;
    protected $deleteTime='delete_time';
    public static function getCategory()
    {
        $cate_list=Category::field(true)->select();
        return  $cate_list;
    }
    public static function getNextCate($cate_list,$parentid)
    {
        $arr=[];
        foreach ($cate_list as $vv){
            if ($vv['parentid']==$parentid){
                $arr[$vv['id']]=$vv;
                $arr[$vv['id']]['next']=self::getNextCate($cate_list,$vv['id']);
            }
        }
        return  $arr;
    }
}